package durst.def.calendar;

import java.sql.SQLException;
import java.util.UUID;

import durst.data.UserCalendar;
import durst.data.dao.TestDaoFactory;
import durst.def.DefaultData;

public class DefaultUserCalendar extends UserCalendar implements DefaultData<UserCalendar> {

	public DefaultUserCalendar() {
		super();
	}

	@Override
	public UserCalendar create(boolean persist) throws SQLException {
		UserCalendar ret = new UserCalendar(UUID.randomUUID().toString(), UserCalendar.SharedStatus.PUBLIC);
		
		if (persist) {
			TestDaoFactory.createDao(UserCalendar.class).create(ret);
		}
		
		return ret;
	}
}
